<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>档案管理（正卷）</title>
    <link href="/static/css/layout.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/cb.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/n.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/communcity.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/static/easyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="/static/easyui/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="/static/easyui/demo/demo.css" />
    <link rel="stylesheet" type="text/css" href="/static/js/laypage/skin/laypage.css" />
    <script type="text/javascript" src="/static/easyui/jquery.min.js"></script>
    <script src="/static/js/vue/vue.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/js/laypage/laypage.js"></script>
    <script type="text/javascript" src="/static/laydate/laydate.js"></script>
    <script type="text/javascript" src="${request.contextPath}/static/js/work-mange.js"></script>
    <script type="text/javascript" src="${request.contextPath}/static/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div id="app" style="width: 2050px;height: 760px;overflow: auto;">
    <table width="99%" border="0" align="center" cellpadding="0"
           cellspacing="0">
        <tr>
            <td width="1%" align="left" background="/static/images/b2.jpg"><img
                    src="/static/images/b1.jpg" width="10" height="26" /></td>
            <td width="68%" background="/static/images/b2.jpg"><table
                    width="124" border="0" align="left" cellpadding="0"
                    cellspacing="0">
                <tr>
                    <td width="20" align="left"><img src="/static/images/tz.gif"
                                                     width="10" height="16" /></td>
                    <td width="104" align="left" class="biao">查找档案信息</td>
                </tr>
            </table></td>
            <td width="31%" align="right" background="/static/images/b2.jpg"><img
                    src="/static/images/b3.jpg" width="9" height="26" /></td>
        </tr>
    </table>
    <table width="99%" border="0" align="center" cellpadding="3"
           cellspacing="1" bgcolor="#AEDEF4">
        <tr>
            <td align="center" bgcolor="#E2F7FE">
                <form id="form1" name="form1" method="post" action="">
                    <table width="80%" border="0" cellspacing="1" cellpadding="3">
                        <tr>
                            <td width="10%" align="right">身份证号:</td>
                            <td width="10%" align="left"><input type="text" id="papersnum" size="30" /></td>
                            <td width="10%" align="right">姓名:</td>
                            <td width="10%" align="left"><input type="text" id="name"
                                                                size="15" /></td>
                            <td width="10%" align="left"><input type="button"
                                                                id="querycheck" value="查找" /></td>
                            <td width="10%" colspan="2" align="right"><input
                                    type="button" onclick="addEvent()" name="" value="增加档案" /> </td>
                        </tr>
                    </table>
                </form>
            </td>
        </tr>
    </table>

    <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="5"></td>
        </tr>
    </table>
    <table width="99%" border="0" align="center" cellpadding="0"
           cellspacing="0">
        <tr>
            <td width="1%" align="left" background="/static/images/b2.jpg"><img
                    src="/static/images/b1.jpg" width="10" height="26" /></td>
            <td width="68%" background="/static/images/b2.jpg"><table
                    width="124" border="0" align="left" cellpadding="0"
                    cellspacing="0">
                <tr>
                    <td width="20" align="left"><img src="/static/images/tz.gif"<#--../images/tz.gif-->
                                                     width="10" height="16" /></td>
                    <td width="104" align="left" class="biao">档案列表</td>
                </tr>
            </table></td>
            <td width="31%" align="right" background="/static/images/b2.jpg"><img
                    src="/static/images/b3.jpg" width="9" height="26" /></td>
        </tr>
    </table>
    <table width="99%" border="0" align="center" cellpadding="3"
           cellspacing="1" bgcolor="#AEDEF4" style="border: 1px solid #AEDEF4">
        <thead>
        <tr>
            <td align="center" bgcolor="#EFFBFE">序号</td>
            <td align="center" bgcolor="#EFFBFE" style="width: 66px; height: 38px">姓名</td>
            <td align="center" bgcolor="#EFFBFE">身份证号</td>
            <td align="center" bgcolor="#EFFBFE">刑事判决书、决定书、执行通知书</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正宣告书</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员登记表</td>
            <td align="center" bgcolor="#EFFBFE">接受社区矫正保证书</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员矫正方案</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正监护责任书</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正志愿者帮教协议书</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员奖惩审批表及相关材料</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员奖励(处罚)通知书</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员年度考核材料</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员脱逃、下落不明及死亡情况登记表及其相关材料</td>
            <td align="center" bgcolor="#EFFBFE">社区服刑人员异地委托管理、报备管理相关材料</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正期满鉴定表</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正期满合议表</td>
            <td align="center" bgcolor="#EFFBFE">社区矫正期满宣告书</td>
            <td align="center" bgcolor="#EFFBFE">解除管制通知书、假释考验期满通知书、恢复政治权利通知书、缓刑考验期满通知书</td>
            <td align="center" bgcolor="#EFFBFE">其他有长期保存价值的资料</td>
            <td align="center" bgcolor="#EFFBFE">管理操作</td>
        </tr>
        </thead>
        <tbody>
        <tr v-for="(item,index) in result"
            onmouseout="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"
            onmouseover="this.style.backgroundColor='#E6F2FF'">
            <td style="width: 50px;" align="center">{{index+1}}</td>
            <td align="center" class="t5">
                <div align="center"><strong>{{item.name}}</strong></div></td>
            <td style="width: 200px;" align="center">{{item.papersnum}}</td>
            <td align="center">{{item.tm1}}</td>
            <td align="center">{{item.tm2}}</td>
            <td align="center">{{item.tm3}}</td>
            <td align="center">{{item.tm4}}</td>
            <td align="center">{{item.tm5}}</td>
            <td align="center">{{item.tm6}}</td>
            <td align="center">{{item.tm7}}</td>
            <td align="center">{{item.tm8}}</td>
            <td align="center">{{item.tm9}}</td>
            <td align="center">{{item.tm10}}</td>
            <td align="center">{{item.tm11}}</td>
            <td align="center">{{item.tm12}}</td>
            <td align="center">{{item.tm13}}</td>
            <td align="center">{{item.tm14}}</td>
            <td align="center">{{item.tm15}}</td>
            <td align="center">{{item.tm16}}</td>
            <td align="center">{{item.tm17}}</td>

            <td align="left" width="100px" height="38px">
                <div align="left" style="padding-left: 5px">
                    <div align="center">
                        <input type="button" @click="checkEvent(item.id)" name="" value="查看" />
                        <input type="button" @click="editEvent(item.id)" name="" value="修改" />
                        <input type="button" @click="delEvent(item.id)" name="" value="删除" />
                    </div>
                </div>
            </td>
        </tr>

        <tr>
            <td colspan="10" align="center">
                <div id="pagediv"></div>
            </td>
        </tr>
        </tbody>
    </table>
    <!-- 增加档案弹出框 -->
    <div id="dlg"></div>
    <#-- 增加档案修改框 -->
    <div id="editDlg"></div>
    <!-- 查看档案弹出框 -->
    <div id="dlg1"></div>
</div>

<!-- js代码控制增删改查弹出层 -->
<script>
    var app = new Vue({
        el : '#app',
        data : {
            result : []
        }
    });
    //模糊查询分页列表
    var getPageList = function(curr) {
        $.ajax({
            type : "get",
            dataType : "json",
            url : "/cAdminMain/get",
            data : {
                pageNum : curr || 1,
                pageSize : 15,
                name : $("#name").val(),
                papersnum : $("#papersnum").val()
            },

            //显示分页
            success : function(msg) {
                app.result = msg.data[0].result;
                laypage({
                    cont : 'pagediv', //容器。值支持id名、原生dom对象，jquery对象,
                    pages : msg.data[0].totalPage, //总页数
                    first : "首页",
                    last : "尾页",
                    skip : true, //是否开启跳页
                    skin : '#5675A2',
                    curr : curr || 1, //当前页
                    jump : function(obj, first) { //触发分页后的回调
                        if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
                            getPageList(obj.curr);
                        }
                    }
                });
            }
        });
    }
    //获取档案记录列表
    getPageList();

    //模糊查询档案记录
    $('#querycheck').on('click', function() {
        getPageList();
    });
    //增加档案记录

    var addEvent = function() {
        $('#dlg').dialog({
            title : '增加---档案',
            width : 920,
            height : 550,
            left: 400,
            top: 150,
            closed : false,
            cache : false,
            minimizable:true,
            maximizable:true,
            resizable:true,
            href : '/cAdminMain/addMain',
            modal : true,
            buttons : [ {
                text : '保存',
                iconCls : 'icon-ok',
                handler : function() {
                    if ($("#form2").form('validate')) {
                        $.ajax({
                            url: "/cAdminMain/upload", /*发送请求的地址*/
                            type: "post", /*请求方式*/
                            /*dataType: "json", /!*服务器返回的数据类T型*!/*/
                            contentType: false, /*内容编码类型*/
                            processData: false, /*发送数据转为对象*/
                            async: true, /*请求为异步请求*/
                            cache: false, /*是否从浏览器缓存中加载请求信息*/
                            data: new FormData($("#form2")[0]), /*数据*/
                            success: function (result) { /*请求成功后调用的回调函数*/
                                $.messager.alert({
                                    title: '消息',
                                    msg: '保存成功!',
                                    icon: 'info'
                                });
                                getPageList();
                                $('#dlg').dialog('close');
                            }
                        });
                    }
                }
            }, {
                text : '关闭',
                handler : function() {
                    $('#dlg').dialog('close');
                }
            }]
        });
    }


    var editEvent = function (id) { /*comcn155 添加修改档案点击事件*/
        $('#editDlg').dialog({
            title : '修改---档案',
            width : 920,
            height : 550,
            left: 400,
            top: 150,
            closed : false,
            cache : false,
            minimizable:true,
            maximizable:true,
            resizable:true,
            href : '/cAdminMain/getId?sort=editMain&id='+id,
            modal : true,
            buttons : [ {
                text : '保存',
                iconCls : 'icon-ok',
                handler : function() {
                    if($("#editFormMain").form('validate')){
                        $.ajax({
                            url : "/cAdminMain/uploadEditMain",
                            type : "post",
                            contentType: false,
                            processData: false,
                            async: true,
                            cache: false,
                            data : new FormData($("#editFormMain")[0]),
                            success : function(result) {
                                $.messager.alert({
                                    title : '消息',
                                    msg : '修改成功!',
                                    icon : 'info'
                                });
                                getPageList();
                                $('#editDlg').dialog('close');
                            }
                        });
                    }
                }
            }, {
                text : '关闭',
                handler : function() {
                    $('#editDlg').dialog('close');
                }
            }]
        })
    }

    //查看档案详情
    var checkEvent = function(id) {
        $('#dlg1').dialog({
            title : '查看---档案详情',
            width : 720,
            height : 400,
            left: 500,
            top: 150,
            closed : false,
            cache : false,
            minimizable:true,
            maximizable:true,
            resizable:true,
            href : '/cAdminMain/getId?id=' + id,
            modal : true,
            buttons : [ {
                text : '关闭',
                handler : function() {
                    $('#dlg1').dialog('close');
                }
            } ]
        });
    }

    //删除档案
    var delEvent = function(id) {
        $.messager.confirm('提示框', '你确定要删除吗?', function(res) {
            if (res) {
                $.ajax({
                    url : "/cAdminMain/del",
                    type : "post",
                    dataType : "json",
                    data : {
                        id : id
                    },
                    success : function(result) {
                        $.messager.alert({
                            title : '消息',
                            msg : '删除成功!',
                            icon : 'info'
                        });
                        getPageList();
                    }
                });
            } else {
                //取消删除
            }
        })
    }
</script>



</body>
</html>